package utilities;
/**
 * Provide some utilities for data storing.
 * @author QiuShuang
 */

public class Pair< T > {
/*  Overview : A pair is an ordered container that holds two objects of the same type.  */
	private T _first;							/*  First object in pair.  */
	private T _second;							/*  Second object in pair. */
	
	/*  Constructor  */
	/**
	 * Create a pair. Both element of <i>this</i> is set to <b>null</b>.
	 */
	public Pair(){
		_first = null;
		_second = null;
	}
	
	/*  Setter  */
	/**
	 * Set the first element of <i>this</i> the specified Object.
	 * @param first Element to be set
	 */
	public void setFirst( T first ){
		_first = first;
	}
	
	/**
	 * Set the second element of <i>this</i> the specified Object.
	 * @param second Element to be set
	 */
	public void setSecond( T second ){
		_second = second;
	}
	
	/*  Getter  */
	/**
	 * Get first element of <i>this</i>.
	 * @return Fist element in this paie
	 */
	public T getFirst(){
		return _first;
	}
	
	/**
	 * Get second element of <i>this</i>.
	 * @return Second element in this pair
	 */
	public T getSecond(){
		return _second;
	}
}
